{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "65fc79f0",
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = 'all'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0364b476",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pyecharts import charts as ch\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.globals import ThemeType\n",
    "from pyecharts.commons.utils import JsCode"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c4f1c5b4",
   "metadata": {},
   "source": [
    "导表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "dbb50fcf",
   "metadata": {},
   "outputs": [],
   "source": [
    "NU = pd.read_excel(\"../Data/总用户新增.xlsx\",index_col=\"Date\")\n",
    "Android_2020 =  pd.read_excel(\"../Data/安卓用户新增.xlsx\",sheet_name=\"2020\",index_col=\"Date\")\n",
    "Android_2021 =  pd.read_excel(\"../Data/安卓用户新增.xlsx\",sheet_name=\"2021\",index_col=\"Date\")\n",
    "pv_tab = pd.read_excel(\"../Data/手机端pv分布.xlsx\",index_col=\"Date\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "540dd603",
   "metadata": {},
   "source": [
    "# 拉新用户新增 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fdfe9eaf",
   "metadata": {},
   "outputs": [],
   "source": [
    "NU_2020 = NU[NU.index.year==2020]\n",
    "NU_2021 = NU[NU.index.year==2021]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "850361a2",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\jack\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n",
      "c:\\users\\jack\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n"
     ]
    }
   ],
   "source": [
    "NU_2020[\"日期\"] = NU_2020.index.day\n",
    "NU_2021[\"日期\"] = NU_2021.index.day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e2b88d46",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"5e4734436968411eb70dd49825465afb\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_5e4734436968411eb70dd49825465afb = echarts.init(\n",
       "                    document.getElementById('5e4734436968411eb70dd49825465afb'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_5e4734436968411eb70dd49825465afb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"2021\\u5e74\\u5b89\\u5353\\u65b0\\u7528\\u6237\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                257,\n",
       "                692,\n",
       "                811,\n",
       "                253\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barWidth\": 80,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 15\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"2021\\u5e74\\u82f9\\u679c\\u65b0\\u7528\\u6237\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                58,\n",
       "                116,\n",
       "                135,\n",
       "                50\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 15\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"2021\\u5e74\\u5b89\\u5353\\u65b0\\u7528\\u6237\",\n",
       "                \"2021\\u5e74\\u82f9\\u679c\\u65b0\\u7528\\u6237\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"2021\\u5e74\\u5b89\\u5353\\u65b0\\u7528\\u6237\": true,\n",
       "                \"2021\\u5e74\\u82f9\\u679c\\u65b0\\u7528\\u6237\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u65e5\\u671f\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                17,\n",
       "                18,\n",
       "                19,\n",
       "                20\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u65b0\\u7528\\u6237\\u6570\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_5e4734436968411eb70dd49825465afb.setOption(option_5e4734436968411eb70dd49825465afb);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d1d488d0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Bar(init_opts=opts.InitOpts(theme=ThemeType.MACARONS))\n",
    "    .add_xaxis([17,18,19,20])\n",
    "    .add_yaxis(\"2021年安卓新用户\", NU_2021[\"安卓\"].to_list(), stack=\"stack1\",label_opts=opts.LabelOpts(is_show=True,font_size=15,position='right'),bar_width=80)\n",
    "    .add_yaxis(\"2021年苹果新用户\", NU_2021[\"苹果\"].to_list(), stack=\"stack1\",label_opts=opts.LabelOpts(is_show=True,font_size=15,position='right'),)\n",
    "    .set_global_opts(\n",
    "    xaxis_opts=opts.AxisOpts(name=\"日期\"),\n",
    "    yaxis_opts=opts.AxisOpts(name=\"新用户数\")\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "65664934",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d885b49b95984b27a23991b2baf5749d\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_d885b49b95984b27a23991b2baf5749d = echarts.init(\n",
       "                    document.getElementById('d885b49b95984b27a23991b2baf5749d'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_d885b49b95984b27a23991b2baf5749d = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"2020\\u5e74\\u5b89\\u5353\\u65b0\\u7528\\u6237\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                212,\n",
       "                292,\n",
       "                259,\n",
       "                197\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barWidth\": 80,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 15\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"2020\\u5e74\\u82f9\\u679c\\u65b0\\u7528\\u6237\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                34,\n",
       "                43,\n",
       "                44,\n",
       "                30\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 15\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"2020\\u5e74\\u5b89\\u5353\\u65b0\\u7528\\u6237\",\n",
       "                \"2020\\u5e74\\u82f9\\u679c\\u65b0\\u7528\\u6237\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"2020\\u5e74\\u5b89\\u5353\\u65b0\\u7528\\u6237\": true,\n",
       "                \"2020\\u5e74\\u82f9\\u679c\\u65b0\\u7528\\u6237\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u65e5\\u671f\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                17,\n",
       "                18,\n",
       "                19,\n",
       "                20\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u65b0\\u7528\\u6237\\u6570\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_d885b49b95984b27a23991b2baf5749d.setOption(option_d885b49b95984b27a23991b2baf5749d);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d247a860>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Bar(init_opts=opts.InitOpts(theme=ThemeType.MACARONS))\n",
    "    .add_xaxis([17,18,19,20])\n",
    "    .add_yaxis(\"2020年安卓新用户\", NU_2020[\"安卓\"].to_list(), stack=\"stack1\",label_opts=opts.LabelOpts(is_show=True,font_size=15,position='right'),bar_width=80)\n",
    "    .add_yaxis(\"2020年苹果新用户\", NU_2020[\"苹果\"].to_list(), stack=\"stack1\",label_opts=opts.LabelOpts(is_show=True,font_size=15,position='right'))\n",
    "    .set_global_opts(\n",
    "    xaxis_opts=opts.AxisOpts(name=\"日期\"),\n",
    "    yaxis_opts=opts.AxisOpts(name=\"新用户数\")\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fd8f7937",
   "metadata": {},
   "source": [
    "#  新用户留存率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "316204d5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>DNU</th>\n",
       "      <th>1日留存</th>\n",
       "      <th>2日留存</th>\n",
       "      <th>3日留存</th>\n",
       "      <th>4日留存</th>\n",
       "      <th>5日留存</th>\n",
       "      <th>6日留存</th>\n",
       "      <th>7日留存</th>\n",
       "      <th>15日留存</th>\n",
       "      <th>30日留存</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-05-17</th>\n",
       "      <td>212</td>\n",
       "      <td>0.3868</td>\n",
       "      <td>0.3066</td>\n",
       "      <td>0.2170</td>\n",
       "      <td>0.1981</td>\n",
       "      <td>0.1934</td>\n",
       "      <td>0.1792</td>\n",
       "      <td>0.1934</td>\n",
       "      <td>0.1509</td>\n",
       "      <td>0.1368</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>292</td>\n",
       "      <td>0.3938</td>\n",
       "      <td>0.3253</td>\n",
       "      <td>0.2568</td>\n",
       "      <td>0.2603</td>\n",
       "      <td>0.2226</td>\n",
       "      <td>0.1849</td>\n",
       "      <td>0.2329</td>\n",
       "      <td>0.2158</td>\n",
       "      <td>0.1575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>259</td>\n",
       "      <td>0.3938</td>\n",
       "      <td>0.2741</td>\n",
       "      <td>0.2317</td>\n",
       "      <td>0.2201</td>\n",
       "      <td>0.1853</td>\n",
       "      <td>0.1737</td>\n",
       "      <td>0.1892</td>\n",
       "      <td>0.1081</td>\n",
       "      <td>0.1236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>197</td>\n",
       "      <td>0.2995</td>\n",
       "      <td>0.2386</td>\n",
       "      <td>0.1624</td>\n",
       "      <td>0.1675</td>\n",
       "      <td>0.1980</td>\n",
       "      <td>0.1726</td>\n",
       "      <td>0.1320</td>\n",
       "      <td>0.1472</td>\n",
       "      <td>0.0609</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            DNU    1日留存    2日留存    3日留存    4日留存    5日留存    6日留存    7日留存  \\\n",
       "Date                                                                      \n",
       "2020-05-17  212  0.3868  0.3066  0.2170  0.1981  0.1934  0.1792  0.1934   \n",
       "2020-05-18  292  0.3938  0.3253  0.2568  0.2603  0.2226  0.1849  0.2329   \n",
       "2020-05-19  259  0.3938  0.2741  0.2317  0.2201  0.1853  0.1737  0.1892   \n",
       "2020-05-20  197  0.2995  0.2386  0.1624  0.1675  0.1980  0.1726  0.1320   \n",
       "\n",
       "             15日留存   30日留存  \n",
       "Date                        \n",
       "2020-05-17  0.1509  0.1368  \n",
       "2020-05-18  0.2158  0.1575  \n",
       "2020-05-19  0.1081  0.1236  \n",
       "2020-05-20  0.1472  0.0609  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>DNU</th>\n",
       "      <th>1日留存</th>\n",
       "      <th>2日留存</th>\n",
       "      <th>3日留存</th>\n",
       "      <th>4日留存</th>\n",
       "      <th>5日留存</th>\n",
       "      <th>6日留存</th>\n",
       "      <th>7日留存</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-05-17</th>\n",
       "      <td>257</td>\n",
       "      <td>0.3930</td>\n",
       "      <td>0.3113</td>\n",
       "      <td>0.2296</td>\n",
       "      <td>0.2140</td>\n",
       "      <td>0.2296</td>\n",
       "      <td>0.1479</td>\n",
       "      <td>0.1634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>692</td>\n",
       "      <td>0.1922</td>\n",
       "      <td>0.1199</td>\n",
       "      <td>0.1257</td>\n",
       "      <td>0.0824</td>\n",
       "      <td>0.0954</td>\n",
       "      <td>0.1012</td>\n",
       "      <td>0.0910</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>811</td>\n",
       "      <td>0.1689</td>\n",
       "      <td>0.1147</td>\n",
       "      <td>0.0764</td>\n",
       "      <td>0.0691</td>\n",
       "      <td>0.0814</td>\n",
       "      <td>0.0666</td>\n",
       "      <td>0.0727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>253</td>\n",
       "      <td>0.2885</td>\n",
       "      <td>0.1858</td>\n",
       "      <td>0.1779</td>\n",
       "      <td>0.1383</td>\n",
       "      <td>0.1423</td>\n",
       "      <td>0.1818</td>\n",
       "      <td>0.1653</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            DNU    1日留存    2日留存    3日留存    4日留存    5日留存    6日留存    7日留存\n",
       "Date                                                                   \n",
       "2020-05-17  257  0.3930  0.3113  0.2296  0.2140  0.2296  0.1479  0.1634\n",
       "2020-05-18  692  0.1922  0.1199  0.1257  0.0824  0.0954  0.1012  0.0910\n",
       "2020-05-19  811  0.1689  0.1147  0.0764  0.0691  0.0814  0.0666  0.0727\n",
       "2020-05-20  253  0.2885  0.1858  0.1779  0.1383  0.1423  0.1818  0.1653"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Android_2020\n",
    "Android_2021"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "38e84acd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c01dd6e2863e4e6baebcce9707b0a644\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_c01dd6e2863e4e6baebcce9707b0a644 = echarts.init(\n",
       "                    document.getElementById('c01dd6e2863e4e6baebcce9707b0a644'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_c01dd6e2863e4e6baebcce9707b0a644 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.3868\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.3066\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.217\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1981\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1934\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1792\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1934\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1509\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1368\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"30\\u65e5\\u7559\\u5b58\",\n",
       "                \"15\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"15\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"30\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_c01dd6e2863e4e6baebcce9707b0a644.setOption(option_c01dd6e2863e4e6baebcce9707b0a644);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d2493128>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2020.columns[1:],Android_2020.iloc[0][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "0e453ce7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"92f4dfd0eb5f4f22a05233ea61cf4728\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_92f4dfd0eb5f4f22a05233ea61cf4728 = echarts.init(\n",
       "                    document.getElementById('92f4dfd0eb5f4f22a05233ea61cf4728'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_92f4dfd0eb5f4f22a05233ea61cf4728 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.3938\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.3253\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2568\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2603\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2226\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1849\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2329\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2158\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1575\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"30\\u65e5\\u7559\\u5b58\",\n",
       "                \"15\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"15\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"30\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_92f4dfd0eb5f4f22a05233ea61cf4728.setOption(option_92f4dfd0eb5f4f22a05233ea61cf4728);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d2434c50>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"a27942bf37cf4e45b66a0871e0f00646\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_a27942bf37cf4e45b66a0871e0f00646 = echarts.init(\n",
       "                    document.getElementById('a27942bf37cf4e45b66a0871e0f00646'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_a27942bf37cf4e45b66a0871e0f00646 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.3938\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2741\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2317\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2201\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1853\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1737\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1892\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1081\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1236\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"30\\u65e5\\u7559\\u5b58\",\n",
       "                \"15\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"15\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"30\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_a27942bf37cf4e45b66a0871e0f00646.setOption(option_a27942bf37cf4e45b66a0871e0f00646);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d24934a8>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c743b555aa7d41bd8d27abb6c44d58b1\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_c743b555aa7d41bd8d27abb6c44d58b1 = echarts.init(\n",
       "                    document.getElementById('c743b555aa7d41bd8d27abb6c44d58b1'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_c743b555aa7d41bd8d27abb6c44d58b1 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2995\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2386\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1624\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1675\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.198\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1726\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.132\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1472\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0609\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"30\\u65e5\\u7559\\u5b58\",\n",
       "                \"15\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"15\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"30\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_c743b555aa7d41bd8d27abb6c44d58b1.setOption(option_c743b555aa7d41bd8d27abb6c44d58b1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d017c7b8>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2020.columns[1:],Android_2020.iloc[1][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")\n",
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2020.columns[1:],Android_2020.iloc[2][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")\n",
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2020.columns[1:],Android_2020.iloc[3][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "e7f3057a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"fcafa71cc1fc45cfb5a257185ead3126\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_fcafa71cc1fc45cfb5a257185ead3126 = echarts.init(\n",
       "                    document.getElementById('fcafa71cc1fc45cfb5a257185ead3126'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_fcafa71cc1fc45cfb5a257185ead3126 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.393\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.3113\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2296\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.214\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2296\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1479\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1634\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_fcafa71cc1fc45cfb5a257185ead3126.setOption(option_fcafa71cc1fc45cfb5a257185ead3126);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d243b7f0>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b8b2e8db7e7740ea84c737b7889872c2\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_b8b2e8db7e7740ea84c737b7889872c2 = echarts.init(\n",
       "                    document.getElementById('b8b2e8db7e7740ea84c737b7889872c2'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_b8b2e8db7e7740ea84c737b7889872c2 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1922\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1199\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1257\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0824\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0954\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1012\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.091\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_b8b2e8db7e7740ea84c737b7889872c2.setOption(option_b8b2e8db7e7740ea84c737b7889872c2);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d1d48978>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"2356cde39b78499f905656d8f8dbfa5a\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_2356cde39b78499f905656d8f8dbfa5a = echarts.init(\n",
       "                    document.getElementById('2356cde39b78499f905656d8f8dbfa5a'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_2356cde39b78499f905656d8f8dbfa5a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1689\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1147\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0764\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0691\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0814\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0666\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.0727\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_2356cde39b78499f905656d8f8dbfa5a.setOption(option_2356cde39b78499f905656d8f8dbfa5a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d1d489b0>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"23c4ea79d877408796a1c05acf80e165\" style=\"width:700px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_23c4ea79d877408796a1c05acf80e165 = echarts.init(\n",
       "                    document.getElementById('23c4ea79d877408796a1c05acf80e165'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_23c4ea79d877408796a1c05acf80e165 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u65e5\\u5e38\\u7528\\u6237\\u884c\\u4e3a\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.2885\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1858\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1779\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1383\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1423\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1818\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    \"value\": 0.1653\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 0,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"6\\u65e5\\u7559\\u5b58\",\n",
       "                \"7\\u65e5\\u7559\\u5b58\",\n",
       "                \"5\\u65e5\\u7559\\u5b58\",\n",
       "                \"2\\u65e5\\u7559\\u5b58\",\n",
       "                \"1\\u65e5\\u7559\\u5b58\",\n",
       "                \"3\\u65e5\\u7559\\u5b58\",\n",
       "                \"4\\u65e5\\u7559\\u5b58\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"1\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"2\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"3\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"4\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"5\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"6\\u65e5\\u7559\\u5b58\": true,\n",
       "                \"7\\u65e5\\u7559\\u5b58\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_23c4ea79d877408796a1c05acf80e165.setOption(option_23c4ea79d877408796a1c05acf80e165);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d247aeb8>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2021.columns[1:],Android_2021.iloc[0][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")\n",
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2021.columns[1:],Android_2021.iloc[1][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")\n",
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2021.columns[1:],Android_2021.iloc[2][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")\n",
    "(\n",
    "    ch.Funnel(init_opts=opts.InitOpts(width=\"700px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"日常用户行为\",[list(z) for z in zip(Android_2021.columns[1:],Android_2021.iloc[3][1:])])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "3adbaa4c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"404a56a4313a4576a92f4485d3788433\" style=\"width:1000px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_404a56a4313a4576a92f4485d3788433 = echarts.init(\n",
       "                    document.getElementById('404a56a4313a4576a92f4485d3788433'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_404a56a4313a4576a92f4485d3788433 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"17\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.393\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.3113\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2296\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.214\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2296\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1479\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1634\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"18\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1922\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1199\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1257\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0824\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0954\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1012\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.091\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"19\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1689\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1147\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0764\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0691\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0814\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0666\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0727\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"20\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2885\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1858\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1779\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1383\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1423\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1818\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1653\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"17\\u65e5\",\n",
       "                \"18\\u65e5\",\n",
       "                \"19\\u65e5\",\n",
       "                \"20\\u65e5\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"17\\u65e5\": true,\n",
       "                \"18\\u65e5\": true,\n",
       "                \"19\\u65e5\": true,\n",
       "                \"20\\u65e5\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"axis\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"category\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"boundaryGap\": false,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": null\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": false,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {},\n",
       "                \"xAxisIndex\": false,\n",
       "                \"yAxisIndex\": false,\n",
       "                \"filterMode\": \"filter\"\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "};\n",
       "                chart_404a56a4313a4576a92f4485d3788433.setOption(option_404a56a4313a4576a92f4485d3788433);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132b77f2b00>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Line(init_opts=opts.InitOpts(width=\"1000px\", height=\"500px\",theme=ThemeType.MACARONS))\n",
    "    .add_xaxis(Android_2021.columns[1:])\n",
    "    .add_yaxis('17日',Android_2021.iloc[0][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .add_yaxis('18日',Android_2021.iloc[1][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .add_yaxis('19日',Android_2021.iloc[2][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .add_yaxis('20日',Android_2021.iloc[3][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .set_global_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"axis\"),\n",
    "        toolbox_opts=opts.ToolboxOpts(is_show=False),\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"category\", boundary_gap=False),\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            splitline_opts=opts.SplitLineOpts(is_show=True)\n",
    "        ),\n",
    "    ).render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "0b868809",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"59d4ade77d884fd78a408da338032939\" style=\"width:1000px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_59d4ade77d884fd78a408da338032939 = echarts.init(\n",
       "                    document.getElementById('59d4ade77d884fd78a408da338032939'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_59d4ade77d884fd78a408da338032939 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"17\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.3868\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.3066\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.217\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1981\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1934\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1792\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1934\n",
       "                ],\n",
       "                [\n",
       "                    \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1509\n",
       "                ],\n",
       "                [\n",
       "                    \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1368\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"18\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.3938\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.3253\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2568\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2603\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2226\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1849\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2329\n",
       "                ],\n",
       "                [\n",
       "                    \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2158\n",
       "                ],\n",
       "                [\n",
       "                    \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1575\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"19\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.3938\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2741\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2317\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2201\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1853\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1737\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1892\n",
       "                ],\n",
       "                [\n",
       "                    \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1081\n",
       "                ],\n",
       "                [\n",
       "                    \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1236\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"20\\u65e5\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2995\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u65e5\\u7559\\u5b58\",\n",
       "                    0.2386\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1624\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1675\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u65e5\\u7559\\u5b58\",\n",
       "                    0.198\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1726\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u65e5\\u7559\\u5b58\",\n",
       "                    0.132\n",
       "                ],\n",
       "                [\n",
       "                    \"15\\u65e5\\u7559\\u5b58\",\n",
       "                    0.1472\n",
       "                ],\n",
       "                [\n",
       "                    \"30\\u65e5\\u7559\\u5b58\",\n",
       "                    0.0609\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"17\\u65e5\",\n",
       "                \"18\\u65e5\",\n",
       "                \"19\\u65e5\",\n",
       "                \"20\\u65e5\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"17\\u65e5\": true,\n",
       "                \"18\\u65e5\": true,\n",
       "                \"19\\u65e5\": true,\n",
       "                \"20\\u65e5\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"axis\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"category\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"boundaryGap\": false,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": null\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": false,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {},\n",
       "                \"xAxisIndex\": false,\n",
       "                \"yAxisIndex\": false,\n",
       "                \"filterMode\": \"filter\"\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "};\n",
       "                chart_59d4ade77d884fd78a408da338032939.setOption(option_59d4ade77d884fd78a408da338032939);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d2434b70>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Line(init_opts=opts.InitOpts(width=\"1000px\", height=\"500px\",theme=ThemeType.MACARONS))\n",
    "    .add_xaxis(Android_2020.columns[1:])\n",
    "    .add_yaxis('17日',Android_2020.iloc[0][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .add_yaxis('18日',Android_2020.iloc[1][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .add_yaxis('19日',Android_2020.iloc[2][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .add_yaxis('20日',Android_2020.iloc[3][1:],label_opts=opts.LabelOpts(is_show=False)\n",
    "              )\n",
    "    .set_global_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"axis\"),\n",
    "        toolbox_opts=opts.ToolboxOpts(is_show=False),\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"category\", boundary_gap=False),\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            splitline_opts=opts.SplitLineOpts(is_show=True)\n",
    "        ),\n",
    "    ).render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "148c1e7a",
   "metadata": {},
   "source": [
    "#  页面点击分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "b0a6e7bd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>eid_1</th>\n",
       "      <th>eid_2</th>\n",
       "      <th>eid_3</th>\n",
       "      <th>eid_4</th>\n",
       "      <th>pv</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>app</td>\n",
       "      <td>back</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>app</td>\n",
       "      <td>fore</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5541</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>fw</td>\n",
       "      <td>bt</td>\n",
       "      <td>gd</td>\n",
       "      <td>NaN</td>\n",
       "      <td>107</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>fw</td>\n",
       "      <td>bt</td>\n",
       "      <td>gd</td>\n",
       "      <td>sys</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>fw</td>\n",
       "      <td>bt</td>\n",
       "      <td>gd</td>\n",
       "      <td>tjhy</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>znt</td>\n",
       "      <td>yzmdl</td>\n",
       "      <td>mmdl</td>\n",
       "      <td>NaN</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>znt</td>\n",
       "      <td>zhdl</td>\n",
       "      <td>jrznt</td>\n",
       "      <td>NaN</td>\n",
       "      <td>206</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>znt</td>\n",
       "      <td>zhdl</td>\n",
       "      <td>qqdl</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>znt</td>\n",
       "      <td>zhdl</td>\n",
       "      <td>wjmm</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>znt</td>\n",
       "      <td>zhdl</td>\n",
       "      <td>wxdl</td>\n",
       "      <td>NaN</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>199 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           eid_1  eid_2  eid_3 eid_4    pv\n",
       "Date                                      \n",
       "2021-05-17   app   back    NaN   NaN  9262\n",
       "2021-05-17   app   fore    NaN   NaN  5541\n",
       "2021-05-17    fw     bt     gd   NaN   107\n",
       "2021-05-17    fw     bt     gd   sys    26\n",
       "2021-05-17    fw     bt     gd  tjhy     5\n",
       "...          ...    ...    ...   ...   ...\n",
       "2021-05-18   znt  yzmdl   mmdl   NaN    14\n",
       "2021-05-18   znt   zhdl  jrznt   NaN   206\n",
       "2021-05-18   znt   zhdl   qqdl   NaN     2\n",
       "2021-05-18   znt   zhdl   wjmm   NaN     2\n",
       "2021-05-18   znt   zhdl   wxdl   NaN    26\n",
       "\n",
       "[199 rows x 5 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pv_tab"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "350786fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "pv_dban = pv_tab[pv_tab.eid_2==\"dban\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "8330aff5",
   "metadata": {},
   "outputs": [],
   "source": [
    "pv_dban = pv_dban[pv_dban.eid_1.isin(['xx','fw','qz','sc','wo'])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "e0c2392e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>eid_1</th>\n",
       "      <th>eid_2</th>\n",
       "      <th>eid_3</th>\n",
       "      <th>eid_4</th>\n",
       "      <th>pv</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>fw</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>qz</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>sc</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>wo</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>xx</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>fw</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>qz</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2041</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>sc</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>wo</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5271</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-18</th>\n",
       "      <td>xx</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8180</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           eid_1 eid_2 eid_3 eid_4     pv\n",
       "Date                                     \n",
       "2021-05-17    fw  dban   NaN   NaN  12218\n",
       "2021-05-17    qz  dban   NaN   NaN   1865\n",
       "2021-05-17    sc  dban   NaN   NaN   1516\n",
       "2021-05-17    wo  dban   NaN   NaN   5227\n",
       "2021-05-17    xx  dban   NaN   NaN   8003\n",
       "2021-05-18    fw  dban   NaN   NaN  12483\n",
       "2021-05-18    qz  dban   NaN   NaN   2041\n",
       "2021-05-18    sc  dban   NaN   NaN   1451\n",
       "2021-05-18    wo  dban   NaN   NaN   5271\n",
       "2021-05-18    xx  dban   NaN   NaN   8180"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pv_dban"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "16184839",
   "metadata": {},
   "outputs": [],
   "source": [
    "pv_dban_17 = pv_dban[pv_dban.index.day==17]\n",
    "pv_dban_18 = pv_dban[pv_dban.index.day==18]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "fa16fc34",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>eid_1</th>\n",
       "      <th>eid_2</th>\n",
       "      <th>eid_3</th>\n",
       "      <th>eid_4</th>\n",
       "      <th>pv</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>fw</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>qz</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>sc</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>wo</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-05-17</th>\n",
       "      <td>xx</td>\n",
       "      <td>dban</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8003</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           eid_1 eid_2 eid_3 eid_4     pv\n",
       "Date                                     \n",
       "2021-05-17    fw  dban   NaN   NaN  12218\n",
       "2021-05-17    qz  dban   NaN   NaN   1865\n",
       "2021-05-17    sc  dban   NaN   NaN   1516\n",
       "2021-05-17    wo  dban   NaN   NaN   5227\n",
       "2021-05-17    xx  dban   NaN   NaN   8003"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pv_dban_17"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "0aaffd5a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"fece32b4fdbf4c8fbda57a766bfee967\" style=\"width:800px; height:800px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_fece32b4fdbf4c8fbda57a766bfee967 = echarts.init(\n",
       "                    document.getElementById('fece32b4fdbf4c8fbda57a766bfee967'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_fece32b4fdbf4c8fbda57a766bfee967 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"5\\u670817\\u65e5\\u5bfc\\u822a\\u9875\\u6807\\u7b7e\\u70b9\\u51fb\\u91cf\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                12218,\n",
       "                1865,\n",
       "                1516,\n",
       "                5227,\n",
       "                8003\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barWidth\": 80,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 15\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"5\\u670818\\u65e5\\u5bfc\\u822a\\u9875\\u6807\\u7b7e\\u70b9\\u51fb\\u91cf\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                12483,\n",
       "                2041,\n",
       "                1451,\n",
       "                5271,\n",
       "                8180\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"stack\": \"stack1\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 15\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"5\\u670817\\u65e5\\u5bfc\\u822a\\u9875\\u6807\\u7b7e\\u70b9\\u51fb\\u91cf\",\n",
       "                \"5\\u670818\\u65e5\\u5bfc\\u822a\\u9875\\u6807\\u7b7e\\u70b9\\u51fb\\u91cf\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"5\\u670817\\u65e5\\u5bfc\\u822a\\u9875\\u6807\\u7b7e\\u70b9\\u51fb\\u91cf\": true,\n",
       "                \"5\\u670818\\u65e5\\u5bfc\\u822a\\u9875\\u6807\\u7b7e\\u70b9\\u51fb\\u91cf\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u6807\\u7b7e\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u670d\\u52a1\",\n",
       "                \"\\u5708\\u5b50\",\n",
       "                \"\\u5546\\u57ce\",\n",
       "                \"\\u6211\",\n",
       "                \"\\u6d88\\u606f\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"PV\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"splitArea\": {\n",
       "                \"show\": false,\n",
       "                \"areaStyle\": {\n",
       "                    \"opacity\": 0\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_fece32b4fdbf4c8fbda57a766bfee967.setOption(option_fece32b4fdbf4c8fbda57a766bfee967);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d3203908>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Bar(init_opts=opts.InitOpts(width=\"800px\",theme=ThemeType.MACARONS,height=\"800px\"))\n",
    "    .add_xaxis([\"服务\",\"圈子\",\"商城\",\"我\",\"消息\"])\n",
    "    .add_yaxis(\"5月17日导航页标签点击量\", pv_dban_17.pv.to_list(), stack=\"stack1\",label_opts=opts.LabelOpts(is_show=True,font_size=15,position='right'),bar_width=80)\n",
    "    .add_yaxis(\"5月18日导航页标签点击量\", pv_dban_18.pv.to_list(), stack=\"stack1\",label_opts=opts.LabelOpts(is_show=True,font_size=15,position='right'),)\n",
    "    .set_global_opts(\n",
    "        xaxis_opts=opts.AxisOpts(name=\"标签\"),\n",
    "        yaxis_opts=opts.AxisOpts(name=\"PV\",splitarea_opts=opts.SplitAreaOpts(is_show=False))\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e1f7f764",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d5c5622a3aa84a9bbfe9f623fd00ef7b\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_d5c5622a3aa84a9bbfe9f623fd00ef7b = echarts.init(\n",
       "                    document.getElementById('d5c5622a3aa84a9bbfe9f623fd00ef7b'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_d5c5622a3aa84a9bbfe9f623fd00ef7b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u56de\\u653e\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u997c\\u72b6\\u56fe\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u670d\\u52a1\",\n",
       "                    \"value\": 12218\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5708\\u5b50\",\n",
       "                    \"value\": 1865\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5546\\u57ce\",\n",
       "                    \"value\": 1516\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6211\",\n",
       "                    \"value\": 5227\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d88\\u606f\",\n",
       "                    \"value\": 8003\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u670d\\u52a1\",\n",
       "                \"\\u5708\\u5b50\",\n",
       "                \"\\u5546\\u57ce\",\n",
       "                \"\\u6211\",\n",
       "                \"\\u6d88\\u606f\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_d5c5622a3aa84a9bbfe9f623fd00ef7b.setOption(option_d5c5622a3aa84a9bbfe9f623fd00ef7b);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d24b37f0>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Pie(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"回放观看时长统计饼状图\",[list(z) for z in zip([\"服务\",\"圈子\",\"商城\",\"我\",\"消息\"],pv_dban_17.pv.to_list())],radius=[\"40%\", \"80%\"])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {d}%\"))\n",
    "    \n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "afc6d0d1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f7ffcd40ce3e4ece88e903fe198386f2\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_f7ffcd40ce3e4ece88e903fe198386f2 = echarts.init(\n",
       "                    document.getElementById('f7ffcd40ce3e4ece88e903fe198386f2'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_f7ffcd40ce3e4ece88e903fe198386f2 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u56de\\u653e\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u997c\\u72b6\\u56fe\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u670d\\u52a1\",\n",
       "                    \"value\": 12483\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5708\\u5b50\",\n",
       "                    \"value\": 2041\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5546\\u57ce\",\n",
       "                    \"value\": 1451\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6211\",\n",
       "                    \"value\": 5271\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d88\\u606f\",\n",
       "                    \"value\": 8180\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u670d\\u52a1\",\n",
       "                \"\\u5708\\u5b50\",\n",
       "                \"\\u5546\\u57ce\",\n",
       "                \"\\u6211\",\n",
       "                \"\\u6d88\\u606f\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_f7ffcd40ce3e4ece88e903fe198386f2.setOption(option_f7ffcd40ce3e4ece88e903fe198386f2);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x132d247add8>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Pie(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"回放观看时长统计饼状图\",[list(z) for z in zip([\"服务\",\"圈子\",\"商城\",\"我\",\"消息\"],pv_dban_18.pv.to_list())],radius=[\"40%\", \"80%\"])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {d}%\"))\n",
    "    \n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ab4ac5be",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
